<!DOCTYPE HTML>
<html lang="zh-tw" >
    <!-- Start book python基础语言 -->
    <head>
        <!-- head:start -->
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>内建属性 | python基础语言</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-splitter/splitter.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-emphasize/plugin.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../01day/section.6.html" />
    
    
    <link rel="prev" href="../03day/section.0.1.2.html" />
    

        <!-- head:end -->
    </head>
    <body>
        <!-- body:start -->
        
    <div class="book"
        data-level="3.4"
        data-chapter-title="内建属性"
        data-filepath="01day/section.4.md"
        data-basepath=".."
        data-revision="Fri Mar 17 2017 08:48:09 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        课程介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="01day/index.html">
            
                
                    <a href="../01day/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        面向对象进阶
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="01day/section.1.0.html">
            
                
                    <a href="../01day/section.1.0.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        元类
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="01day/section.1.1.html">
            
                
                    <a href="../01day/section.1.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        python是动态语言
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="01day/section.1.3.html">
            
                
                    <a href="../01day/section.1.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        __slots__
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="02day/section.4.html">
            
                
                    <a href="../02day/section.4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        生成器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="02day/section.3.html">
            
                
                    <a href="../02day/section.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        迭代器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="02day/section.1.html">
            
                
                    <a href="../02day/section.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        闭包
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="02day/section.2.html">
            
                
                    <a href="../02day/section.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        装饰器
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="02day/index.html">
            
                
                    <a href="../02day/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        其他的知识点
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="03day/section.0.2.html">
            
                
                    <a href="../03day/section.0.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        import导入模块
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="03day/section.1.1.html">
            
                
                    <a href="../03day/section.1.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        循环导入
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="03day/section.0.3.html">
            
                
                    <a href="../03day/section.0.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        作用域
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="03day/section.2.html">
            
                
                    <a href="../03day/section.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        ==、is
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="03day/section.1.html">
            
                
                    <a href="../03day/section.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        深拷贝、浅拷贝
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="03day/section.6.html">
            
                
                    <a href="../03day/section.6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        进制、位运算
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="01day/section.3.html">
            
                
                    <a href="../01day/section.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        私有化
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="01day/section.3.1.html">
            
                
                    <a href="../01day/section.3.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        属性property
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="03day/index.html">
            
                
                    <a href="../03day/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        其他的知识点
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="03day/section.0.1.html">
            
                
                    <a href="../03day/section.0.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        垃圾回收(一)
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="03day/section.0.1.1.html">
            
                
                    <a href="../03day/section.0.1.1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        垃圾回收(二)
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="03day/section.0.1.2.html">
            
                
                    <a href="../03day/section.0.1.2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        垃圾回收(三)-gc模块
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="3.4" data-path="01day/section.4.html">
            
                
                    <a href="../01day/section.4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        内建属性
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="01day/section.6.html">
            
                
                    <a href="../01day/section.6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        内建函数
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="01day/section.7.html">
            
                
                    <a href="../01day/section.7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        集合set
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="02day/section.5.html">
            
                
                    <a href="../02day/section.5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        functools
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="03day/section.4.html">
            
                
                    <a href="../03day/section.4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        模块
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="03day/section.3.html">
            
                
                    <a href="../03day/section.3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        调试
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="03day/section.5.html">
            
                
                    <a href="../03day/section.5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.10.</b>
                        
                        编码风格
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    本書使用 GitBook 釋出
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >python基础语言</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x5185;&#x5EFA;&#x5C5E;&#x6027;">&#x5185;&#x5EFA;&#x5C5E;&#x6027;</h1>
<pre><code class="lang-python">
<span class="hljs-string">&quot;teachclass.py&quot;</span>

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Person</span><span class="hljs-params">(object)</span>:</span>
    <span class="hljs-keyword">pass</span>
</code></pre>
<p>python3.5&#x4E2D;&#x7C7B;&#x7684;&#x5185;&#x5EFA;&#x5C5E;&#x6027;&#x548C;&#x65B9;&#x6CD5;
<img src="../Images/py3class.png" alt="py3class"></p>
<blockquote>
<p>&#x7ECF;&#x5178;&#x7C7B;(&#x65E7;&#x5F0F;&#x7C7B;),&#x65E9;&#x671F;&#x5982;&#x679C;&#x6CA1;&#x6709;&#x8981;&#x7EE7;&#x627F;&#x7684;&#x7236;&#x7C7B;,&#x7EE7;&#x627F;&#x91CC;&#x7A7A;&#x7740;&#x4E0D;&#x5199;&#x7684;&#x7C7B;</p>
</blockquote>
<pre><code class="lang-python"><span class="hljs-comment">#py2&#x4E2D;&#x65E0;&#x7EE7;&#x627F;&#x7236;&#x7C7B;&#xFF0C;&#x79F0;&#x4E4B;&#x7ECF;&#x5178;&#x7C7B;,py3&#x4E2D;&#x5DF2;&#x9ED8;&#x8BA4;&#x7EE7;&#x627F;object</span>
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Person</span>:</span>
    <span class="hljs-keyword">pass</span>
</code></pre>
<p>&#x5B50;&#x7C7B;&#x6CA1;&#x6709;&#x5B9E;&#x73B0;<code>__init__</code>&#x65B9;&#x6CD5;&#x65F6;&#xFF0C;&#x9ED8;&#x8BA4;&#x81EA;&#x52A8;&#x8C03;&#x7528;&#x7236;&#x7C7B;&#x7684;&#x3002;
&#x5982;&#x5B9A;&#x4E49;<code>__init__</code>&#x65B9;&#x6CD5;&#x65F6;&#xFF0C;&#x9700;&#x81EA;&#x5DF1;&#x624B;&#x52A8;&#x8C03;&#x7528;&#x7236;&#x7C7B;&#x7684;  <code>__init__</code>&#x65B9;&#x6CD5;</p>
<table>
<thead>
<tr>
<th>&#x5E38;&#x7528;&#x4E13;&#x6709;&#x5C5E;&#x6027;</th>
<th>&#x8BF4;&#x660E;</th>
<th>&#x89E6;&#x53D1;&#x65B9;&#x5F0F;</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>__init__</code></td>
<td>&#x6784;&#x9020;&#x521D;&#x59CB;&#x5316;&#x51FD;&#x6570;</td>
<td>&#x521B;&#x5EFA;&#x5B9E;&#x4F8B;&#x540E;,&#x8D4B;&#x503C;&#x65F6;&#x4F7F;&#x7528;,&#x5728;<code>__new__</code>&#x540E;</td>
</tr>
<tr>
<td><code>__new__</code></td>
<td>&#x751F;&#x6210;&#x5B9E;&#x4F8B;&#x6240;&#x9700;&#x5C5E;&#x6027;</td>
<td>&#x521B;&#x5EFA;&#x5B9E;&#x4F8B;&#x65F6;</td>
</tr>
<tr>
<td><code>__class__</code></td>
<td>&#x5B9E;&#x4F8B;&#x6240;&#x5728;&#x7684;&#x7C7B;</td>
<td>&#x5B9E;&#x4F8B;.<code>__class__</code></td>
</tr>
<tr>
<td><code>__str__</code></td>
<td>&#x5B9E;&#x4F8B;&#x5B57;&#x7B26;&#x4E32;&#x8868;&#x793A;,&#x53EF;&#x8BFB;&#x6027;</td>
<td>print(&#x7C7B;&#x5B9E;&#x4F8B;),&#x5982;&#x6CA1;&#x5B9E;&#x73B0;&#xFF0C;&#x4F7F;&#x7528;repr&#x7ED3;&#x679C;</td>
</tr>
<tr>
<td><code>__repr__</code></td>
<td>&#x5B9E;&#x4F8B;&#x5B57;&#x7B26;&#x4E32;&#x8868;&#x793A;,&#x51C6;&#x786E;&#x6027;</td>
<td>&#x7C7B;&#x5B9E;&#x4F8B; &#x56DE;&#x8F66; &#x6216;&#x8005; print(repr(&#x7C7B;&#x5B9E;&#x4F8B;))</td>
</tr>
<tr>
<td><code>__del__</code></td>
<td>&#x6790;&#x6784;</td>
<td>del&#x5220;&#x9664;&#x5B9E;&#x4F8B;</td>
</tr>
<tr>
<td><code>__dict__</code></td>
<td>&#x5B9E;&#x4F8B;&#x81EA;&#x5B9A;&#x4E49;&#x5C5E;&#x6027;</td>
<td><code>vars(&#x5B9E;&#x4F8B;.__dict__)</code></td>
</tr>
<tr>
<td><code>__doc__</code></td>
<td>&#x7C7B;&#x6587;&#x6863;,&#x5B50;&#x7C7B;&#x4E0D;&#x7EE7;&#x627F;</td>
<td>help(&#x7C7B;&#x6216;&#x5B9E;&#x4F8B;)</td>
</tr>
<tr>
<td><code>__getattribute__</code></td>
<td>&#x5C5E;&#x6027;&#x8BBF;&#x95EE;&#x62E6;&#x622A;&#x5668;</td>
<td>&#x8BBF;&#x95EE;&#x5B9E;&#x4F8B;&#x5C5E;&#x6027;&#x65F6;</td>
</tr>
<tr>
<td><code>__bases__</code></td>
<td>&#x7C7B;&#x7684;&#x6240;&#x6709;&#x7236;&#x7C7B;&#x6784;&#x6210;&#x5143;&#x7D20;</td>
<td><code>&#x7C7B;&#x540D;.__bases__</code></td>
</tr>
</tbody>
</table>
<p><code>__getattribute__</code>&#x4F8B;&#x5B50;:</p>
<pre><code class="lang-python"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Itcast</span><span class="hljs-params">(object)</span>:</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span><span class="hljs-params">(self,subject1)</span>:</span>
        self.subject1 = subject1
        self.subject2 = <span class="hljs-string">&apos;cpp&apos;</span>

    <span class="hljs-comment">#&#x5C5E;&#x6027;&#x8BBF;&#x95EE;&#x65F6;&#x62E6;&#x622A;&#x5668;&#xFF0C;&#x6253;log</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__getattribute__</span><span class="hljs-params">(self,obj)</span>:</span>
        <span class="hljs-keyword">if</span> obj == <span class="hljs-string">&apos;subject1&apos;</span>:
            print(<span class="hljs-string">&apos;log subject1&apos;</span>)
            <span class="hljs-keyword">return</span> <span class="hljs-string">&apos;redirect python&apos;</span>
        <span class="hljs-keyword">else</span>:   <span class="hljs-comment">#&#x6D4B;&#x8BD5;&#x65F6;&#x6CE8;&#x91CA;&#x6389;&#x8FD9;2&#x884C;&#xFF0C;&#x5C06;&#x627E;&#x4E0D;&#x5230;subject2</span>
            <span class="hljs-keyword">return</span> object.__getattribute__(self,obj)

    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">show</span><span class="hljs-params">(self)</span>:</span>
        print(<span class="hljs-string">&apos;this is Itcast&apos;</span>)

s = Itcast(<span class="hljs-string">&quot;python&quot;</span>)
print(s.subject1)
print(s.subject2)
</code></pre>
<p>&#x8FD0;&#x884C;&#x7ED3;&#x679C;:</p>
<pre><code class="lang-python">
log subject1
redirect python
cpp
</code></pre>
<h3 id="getattribute&#x7684;&#x5751;">__getattribute__&#x7684;&#x5751;</h3>
<pre><code class="lang-python">    <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Person</span><span class="hljs-params">(object)</span>:</span>
        <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__getattribute__</span><span class="hljs-params">(self,obj)</span>:</span>
            print(<span class="hljs-string">&quot;---test---&quot;</span>)
            <span class="hljs-keyword">if</span> obj.startswith(<span class="hljs-string">&quot;a&quot;</span>):
                <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;hahha&quot;</span>
            <span class="hljs-keyword">else</span>:
                <span class="hljs-keyword">return</span> self.test


        <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">test</span><span class="hljs-params">(self)</span>:</span>
            print(<span class="hljs-string">&quot;heihei&quot;</span>)


    t.Person()

    t.a <span class="hljs-comment">#&#x8FD4;&#x56DE;hahha</span>

    t.b <span class="hljs-comment">#&#x4F1A;&#x8BA9;&#x7A0B;&#x5E8F;&#x6B7B;&#x6389;</span>
        <span class="hljs-comment">#&#x539F;&#x56E0;&#x662F;&#xFF1A;&#x5F53;t.b&#x6267;&#x884C;&#x65F6;&#xFF0C;&#x4F1A;&#x8C03;&#x7528;Person&#x7C7B;&#x4E2D;&#x5B9A;&#x4E49;&#x7684;__getattribute__&#x65B9;&#x6CD5;&#xFF0C;&#x4F46;&#x662F;&#x5728;&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x7684;&#x6267;&#x884C;&#x8FC7;&#x7A0B;&#x4E2D;</span>
        <span class="hljs-comment">#if&#x6761;&#x4EF6;&#x4E0D;&#x6EE1;&#x8DB3;&#xFF0C;&#x6240;&#x4EE5; &#x7A0B;&#x5E8F;&#x6267;&#x884C;else&#x91CC;&#x9762;&#x7684;&#x4EE3;&#x7801;&#xFF0C;&#x5373;return self.test  &#x95EE;&#x9898;&#x5C31;&#x5728;&#x8FD9;&#xFF0C;&#x56E0;&#x4E3A;return &#x9700;&#x8981;&#x628A;</span>
        <span class="hljs-comment">#self.test&#x7684;&#x503C;&#x8FD4;&#x56DE;&#xFF0C;&#x90A3;&#x4E48;&#x9996;&#x5148;&#x8981;&#x83B7;&#x53D6;self.test&#x7684;&#x503C;&#xFF0C;&#x56E0;&#x4E3A;self&#x6B64;&#x65F6;&#x5C31;&#x662F;t&#x8FD9;&#x4E2A;&#x5BF9;&#x8C61;&#xFF0C;&#x6240;&#x4EE5;self.test&#x5C31;&#x662F;</span>
        <span class="hljs-comment">#t.test &#x6B64;&#x65F6;&#x8981;&#x83B7;&#x53D6;t&#x8FD9;&#x4E2A;&#x5BF9;&#x8C61;&#x7684;test&#x5C5E;&#x6027;&#xFF0C;&#x90A3;&#x4E48;&#x5C31;&#x4F1A;&#x8DF3;&#x8F6C;&#x5230;__getattribute__&#x65B9;&#x6CD5;&#x53BB;&#x6267;&#x884C;&#xFF0C;&#x5373;&#x6B64;&#x65F6;&#x4EA7;</span>
        <span class="hljs-comment">#&#x751F;&#x4E86;&#x9012;&#x5F52;&#x8C03;&#x7528;&#xFF0C;&#x7531;&#x4E8E;&#x8FD9;&#x4E2A;&#x9012;&#x5F52;&#x8FC7;&#x7A0B;&#x4E2D; &#x6CA1;&#x6709;&#x5224;&#x65AD;&#x4EC0;&#x4E48;&#x65F6;&#x5019;&#x63A8;&#x51FA;&#xFF0C;&#x6240;&#x4EE5;&#x8FD9;&#x4E2A;&#x7A0B;&#x5E8F;&#x4F1A;&#x6C38;&#x65E0;&#x4F11;&#x6B62;&#x7684;&#x8FD0;&#x884C;&#x4E0B;&#x53BB;&#xFF0C;&#x53C8;&#x56E0;&#x4E3A;</span>
        <span class="hljs-comment">#&#x6BCF;&#x6B21;&#x8C03;&#x7528;&#x51FD;&#x6570;&#xFF0C;&#x5C31;&#x9700;&#x8981;&#x4FDD;&#x5B58;&#x4E00;&#x4E9B;&#x6570;&#x636E;&#xFF0C;&#x90A3;&#x4E48;&#x968F;&#x7740;&#x8C03;&#x7528;&#x7684;&#x6B21;&#x6570;&#x8D8A;&#x6765;&#x8D8A;&#x591A;&#xFF0C;&#x6700;&#x7EC8;&#x5185;&#x5B58;&#x5403;&#x5149;&#xFF0C;&#x6240;&#x4EE5;&#x7A0B;&#x5E8F; &#x5D29;&#x6E83;</span>
        <span class="hljs-comment">#</span>
        <span class="hljs-comment"># &#x6CE8;&#x610F;&#xFF1A;&#x4EE5;&#x540E;&#x4E0D;&#x8981;&#x5728;__getattribute__&#x65B9;&#x6CD5;&#x4E2D;&#x8C03;&#x7528;self.xxxx</span>
</code></pre>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../03day/section.0.1.2.html" class="navigation navigation-prev " aria-label="Previous page: 垃圾回收(三)-gc模块"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../01day/section.6.html" class="navigation navigation-next " aria-label="Next page: 内建函数"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-toggle-chapters/toggle.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-splitter/splitter.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"toggle-chapters":{},"splitter":{},"emphasize":{},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        <!-- body:end -->
    </body>
    <!-- End of book python基础语言 -->
</html>
